#include"comm.hpp"

int main()
{
    key_t k = getkey();

    //printf("0x%x\n",k);

    int shmid = createshm(k); 

    //printf("%d\n",shmid);

    sleep(5);

    char* start = (char*)attchshm(shmid);

    printf("attch success, address start: %p\n",start);

    //sleep(5);
    while(true)
    {
        printf("client say: %s\n",start);
        sleep(1);
    }

    detachshm(start);

    sleep(5);

    delshm(shmid);

    return 0;
}